/**
 * 程度选择
 */
import React from 'react';
import { Select } from 'antd';

const SelectWeekTime = React.forwardRef(({ value, onChange, code, ...rest }, ref) => (
    <Select
        style={{ width: 240 }}
        ref={ref}
        value={typeof value === 'number' ? String(value) : value}
        onChange={(_value, item = {}) => {
            const { props = {} } = item;
            const { children } = props;
            onChange(_value, children);
        }}
        getPopupContainer={trigger => trigger.parentElement}
        placeholder="请选择"
        {...rest}
    >
        <Select.Option value="0">星期一</Select.Option>
        <Select.Option value="1">星期二</Select.Option>
        <Select.Option value="2">星期三</Select.Option>
        <Select.Option value="3">星期四</Select.Option>
        <Select.Option value="4">星期五</Select.Option>
    </Select>
));

export default SelectWeekTime;
